home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 46 / Mobiclic46.iso / pc / DATA / SHARED / COMMUNS.CST / 00003_Script_gestion de la navigation < prev    next >
Text File  |  2002-07-12  |  4KB  |  171 lines

  1. -------------------------------------------------------------------
  2. --------------------- GESTION DE LA NAVIGATION --------------------
  3. -------------------------------------------------------------------
  4.  
  5. global gModule
  6. global chemin  -- chemin    : chemin d'accΦs complet au niveau du sommaire
  7. global volumeOn
  8. global touchesOn  -- touchesOn : controle l'activation des raccourcis clavier
  9. global gMyParent
  10. global gNavMode
  11. global gLastMovies
  12.  
  13. -- navigation entre films
  14. on acces
  15.   set n = the paramCount
  16.   if n > 0 then
  17.     initFilm
  18.     gLastMovie = 0
  19.     set nom = chemin
  20.     if n > 1 then
  21.       -- chemin d'accΦs a ΘtΘ envoyΘ sous forme de plusieurs paramΦtres
  22.       repeat with i=1 to n
  23.         if the machineType = 256 then
  24.           set nom = nom & param(i) & "\"
  25.         else
  26.           set nom = nom & param(i) & ":"
  27.         end if
  28.       end repeat
  29.       delete char(the number of chars of nom) of nom
  30.     else
  31.       -- chemin d'accΦs a ΘtΘ envoyΘ sous forme d'un seul paramΦtre
  32.       if offset(":",param(1)) = 0 and offset("\",param(1)) = 0 then
  33.         -- seulement un nom de fichier a ΘtΘ envoyΘ
  34.         set nom = param(1)
  35.       else
  36.         -- un chemin d'accΦs a ΘtΘ envoyΘ
  37.         set n = param(1)
  38.         set nom = nom & nomDos(n)
  39.       end if
  40.     end if
  41.     put "AccΦs au film : " & nom
  42.     set nom=nom & ".dir"
  43.     go to movie nom
  44.     niveauSon
  45.   end if
  46. end
  47.  
  48. on initFilm
  49.   cursor 4
  50.   updateStage
  51.   sound close 2
  52.   sound close 3
  53.   sound close 4
  54. end
  55.  
  56. -- retour au sommaire
  57. on mainWindow
  58.   initFilm
  59.   go to movie chemin & "menu" 
  60.   put "Ouverture sommaire α " & the time
  61.   cursor -1
  62.   sprite(115).member = member "vitrine"
  63.   niveauSon
  64. end
  65.  
  66. -- retour au sommaire rubrique
  67. on somRub
  68.   initFilm
  69.   case gModule of
  70.     1 : acces ("prom","prom01")
  71.     2 : acces ("com","com01")
  72.   end case
  73.   cursor -1
  74.   sprite(114).member = member "debRub"
  75.   niveauSon
  76. end
  77.  
  78. -- retour au film precedent
  79. on precedent  
  80.   updateStage
  81.   sound close 2
  82.   sound close 3
  83.   sound close 4
  84.   gNavMode = #Nav
  85.   lastmovie = gLastMovies[gLastMovies.count]
  86.   if lastmovie = "menu.dir" then
  87.     go to movie chemin & "menu"
  88.   else if lastmovie = "prom01.dir" then
  89.     go to movie "prom01"
  90.   else if lastmovie = "com01.dir" then
  91.     go to movie "com01"
  92.   else
  93.     go to movie gLastMovies[gLastMovies.count]
  94.   end if 
  95.   gLastMovies.deleteAt(gLastMovies.count)
  96.   
  97.   niveauSon
  98. end
  99.  
  100. -- quitter utilitaire
  101. on exitUtil  
  102.   case gMyParent of      
  103.     0:
  104.       --quitter
  105.       if the optionDown=1 then
  106.         closeXlib
  107.         quit
  108.       else
  109.         sound close 3
  110.         acces("communs","generic")
  111.       end if            
  112.     1:
  113.       -- retour sommaire Mobiclic
  114.       touchesOn=1
  115.       sound close 3
  116.       go to movie chemin & "sommaire"    
  117.     2:
  118.       -- retour sommaire Toboclic
  119.       touchesOn=1
  120.       sound close 3
  121.       go to movie chemin & "sommaire"   
  122.   end case
  123. end
  124.  
  125. -------------------------------------------------------------------
  126. ------------------------ GESTION DU CLAVIER -----------------------
  127. -------------------------------------------------------------------
  128.  
  129. -- gestion de la navigation par flΦches
  130. on keyDown
  131.   if touchesOn=1 then
  132.     set k = the keyCode
  133.     set nomCh="shortcuts"
  134.   end if
  135.   repeat with i = 1 to the number of lines of field nomCh
  136.     if k = value(word 1 of line i of field nomCh) then
  137.       set menuMsg = word 2 of line i of field nomCh
  138.       -- annulation raccourci clavier selon activation dans le menu
  139.       case menuMsg of
  140.         "precedent": -- appui sur flΦche gauche
  141.           set liste=value(line 1 of field "Nav")
  142.           if getAt(liste,1)=0 then
  143.             put empty into menuMsg
  144.             exit repeat
  145.           end if
  146.         "suivant": -- appui sur flΦche gauche
  147.           set liste=value(line 1 of field "Nav")
  148.           if getAt(liste,2)=0 then
  149.             put empty into menuMsg
  150.             exit repeat
  151.           end if
  152.       end case
  153.       if menuMsg <> empty then
  154.         do menuMsg
  155.         set menuMsg = empty
  156.       end if
  157.       exit
  158.     end if
  159.   end repeat
  160. end
  161.  
  162. --activation des raccourcis clavier
  163. on touchesOn
  164.   set touchesOn=1
  165. end touchesOn
  166.  
  167. --dΘsactivation des raccourcis clavier
  168. on touchesOff
  169.   set touchesOn=0
  170. end
  171.